<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>回收权限设置</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="${s.base}/css/base/base.css?123456" media="all" /></head>

<body class="childrenBody">
<form class="layui-form">
	<#if powerMember?? >
	<input type="hidden" class="layui-input" id="id" name="id" value="${powerMember.id}"/>
	</#if>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;商品兑换用户编号</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" id="itemMemberCardNo" value="${powerMember.itemMemberCardNo}" name="itemMemberCardNo" placeholder="请输入商品兑换用户编号" lay-verify="required" autocomplete="off" />
		</div>
		<div class="layui-input-block">
			<button class="layui-btn layui-btn-sm" type="button" id="itemMemberSearch">确认</button>
		</div>
	</div>

	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;商品兑换用户昵称</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" id="itemMemberNickName" name="itemMemberNickName" value="${powerMember.itemMemberNickName}" disabled/>
			<input type="hidden" class="layui-input" id="itemMemberId" name="itemMemberId" value="${powerMember.itemMemberId}" disabled/>
		</div>
	</div>

	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;预约用户编号</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" id="orderMemberCardNo" value="${powerMember.orderMemberCardNo}" name="orderMemberCardNo" placeholder="请输入用户编号" lay-verify="required" autocomplete="off" />
		</div>
		<div class="layui-input-block">
			<button class="layui-btn layui-btn-sm" type="button" id="orderMemberSearch">确认</button>
		</div>
	</div>

	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;预约用户昵称</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" id="orderMemberNickName" value="${powerMember.orderMemberNickName}" name="orderMemberNickName" disabled/>
			<input type="hidden" class="layui-input" id="orderMemberId" value="${powerMember.orderMemberId}" name="orderMemberId" disabled/>
		</div>
	</div>

	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;提现用户编号</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" id="withdrawMemberCardNo" value="${powerMember.withdrawMemberCardNo}" name="withdrawMemberCardNo" placeholder="请输入用户编号" lay-verify="required" autocomplete="off" />
		</div>
		<div class="layui-input-block">
			<button class="layui-btn layui-btn-sm" type="button" id="withdrawMemberSearch">确认</button>
		</div>
	</div>

	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;提现用户昵称</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" id="withdrawMemberNickName" value="${powerMember.withdrawMemberNickName}" name="withdrawMemberNickName" disabled/>
			<input type="hidden" class="layui-input" id="withdrawMemberId" value="${powerMember.withdrawMemberId}" name="withdrawMemberId" disabled/>
		</div>
	</div>

	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;名片用户编号</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" id="cardMemberCardNo" value="${powerMember.cardMemberCardNo}" name="cardMemberCardNo" placeholder="请输入用户编号" lay-verify="required" autocomplete="off" />
		</div>
		<div class="layui-input-block">
			<button class="layui-btn layui-btn-sm" type="button" id="cardMemberSearch">确认</button>
		</div>
	</div>

	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;名片用户昵称</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" id="cardMemberNickName" value="${powerMember.cardMemberNickName}" name="cardMemberNickName" disabled/>
			<input type="hidden" class="layui-input" id="cardMemberId" value="${powerMember.cardMemberId}" name="cardMemberId" disabled/>
		</div>
	</div>

	<div class="layui-form-item layui-row layui-col-xs12">
		<div class="layui-input-block">
			<button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="submitBtn">确定</button>
			<button type="reset" class="layui-btn layui-btn-sm layui-btn-primary cancel">取消</button>
		</div>
	</div>
</form>
<script type="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/base/base.js"></script>
<script type="text/javascript">layui.use(['form', 'jquery', 'baseUtil','dialogUtil'],
    function() {
        var form = layui.form,
            $ = layui.jquery,
            dialogUtil = layui.dialogUtil,
            baseUtil = layui.baseUtil;

        $("#itemMemberSearch").on("click",function () {
            var itemMemberCardNo = $("#itemMemberCardNo").val();
            if (itemMemberCardNo == null || itemMemberCardNo == "") {
                dialogUtil.alert("请输入商品兑换用户编号");
                return false;
            }
            baseUtil.postMethodResult("/webMember/selectEntityByCardNo", {cardNo:itemMemberCardNo},
                function(result) {
                    // result
                    console.log(result)
                    $("#itemMemberNickName").val(result.nickName);
                    $("#itemMemberId").val(result.id);
                });
            return false;
        });

        $("#orderMemberSearch").on("click",function () {
            var orderMemberCardNo = $("#orderMemberCardNo").val();
            if (orderMemberCardNo == null || orderMemberCardNo == "") {
                dialogUtil.alert("请输入预约用户编号");
                return false;
            }
            baseUtil.postMethodResult("/webMember/selectEntityByCardNo", {cardNo:orderMemberCardNo},
                function(result) {
                    // result
                    console.log(result)
                    $("#orderMemberNickName").val(result.nickName);
                    $("#orderMemberId").val(result.id);
                });
            return false;
        });

        $("#withdrawMemberSearch").on("click",function () {
            var withdrawMemberCardNo = $("#withdrawMemberCardNo").val();
            if (withdrawMemberCardNo == null || withdrawMemberCardNo == "") {
                dialogUtil.alert("请输入提现用户编号");
                return false;
            }
            baseUtil.postMethodResult("/webMember/selectEntityByCardNo", {cardNo:withdrawMemberCardNo},
                function(result) {
                    // result
                    console.log(result)
                    $("#withdrawMemberNickName").val(result.nickName);
                    $("#withdrawMemberId").val(result.id);
                });
            return false;
        });

		$("#cardMemberSearch").on("click",function () {
			var cardMemberCardNo = $("#cardMemberCardNo").val();
			if (cardMemberCardNo == null || cardMemberCardNo == "") {
				dialogUtil.alert("请输入名片用户编号");
				return false;
			}
			baseUtil.postMethodResult("/webMember/selectEntityByCardNo", {cardNo:cardMemberCardNo},
					function(result) {
						// result
						console.log(result)
						$("#cardMemberNickName").val(result.nickName);
						$("#cardMemberId").val(result.id);
					});
			return false;
		});

        form.on('submit(submitBtn)',
            function(data) {
            	var itemMemberId = data.field.itemMemberId;
				if (itemMemberId == null || itemMemberId == "") {
				    return false;
				}
                var orderMemberId = data.field.orderMemberId;
                if (orderMemberId == null || orderMemberId == "") {
                    return false;
                }
                var withdrawMemberId = data.field.withdrawMemberId;
                if (withdrawMemberId == null || withdrawMemberId == "") {
                    return false;
                }
				var cardMemberId = data.field.cardMemberId;
				if (cardMemberId == null || cardMemberId == "") {
					return false;
				}
                baseUtil.postMethodResult("/powerMember/addOrUpdate", data.field,
                    function(result) {
                        location.reload();
                    });
                return false;
            });
    });
</script>
</body>

</html>